<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
<script>
	function validateForm(){
		var keyword = document.getElementsByName("term");
		var fileName = document.getElementsByName("testSet");
		if((keyword[0].value == "")&&(fileName[0].value == "")){
			alert("Please enter a keyword or select a ready test set to see predictions for.");
			return false;
		}
		else if((keyword[0].value != "")&&(fileName[0].value != "")){
			alert("Please enter either a keyword or select a ready test set to see predictions for.");
			return false;
		}
		else{
			showLoader();
			return true;
		}
	}
	function showLoader(){
		document.getElementById("loader").style.display = "block";
	}
	function hideLoader(){
		document.getElementById("loader").style.display = "none";
	}
</script>
<title>#Sentiment</title>
</head>
<body onunload="hideLoader();">
	<div class="container">
	<div class="searchDiv">
		<h1 class="title">#Sentiment</h1>
		<div class="description">
			Insert the keyword you want to search for or pick a ready test set to see the results
		</div>
		<form action="SearchServlet" onsubmit="return validateForm();"> 
			<input type="text" name="term" class="term" placeholder="Insert the keyword you want to search for..."></input>
			<select class="testSet" name="testSet">
				<option value="">-Select a ready test set-</option>
				<option value="test.txt">Test set</option>
			</select> <br/>
			<input type="submit" value="" class="button"/> 
		</form>
		<img src="loader.gif" id="loader" />
	</div> 
	<div class="copyright">
		By
		<a href="mailto:nantiamakr@gmail.com">Nantia Makrynioti</a>
	</div>
	</div>
</body>
</html>